package com.wg.wuge.study.designmodel.openclosedesigndemo;


public class ApplicationContenxt {
    private AlertRule alertRule;
    private Notification notification;
    private Alert alert;

    public void initializeBeans() {
        alertRule = new AlertRule();
        notification = new Notification();
        alert = new Alert();
        alert.addList(new QpsAlertHandler(alertRule, notification));
        alert.addList(new TpsAlertHandler(alertRule, notification));
    }
    public Alert getAlert() {
        return alert;
    }
    private static final ApplicationContenxt instance = new ApplicationContenxt();
    private ApplicationContenxt() {
        initializeBeans();
    }
    public static ApplicationContenxt getInstance() {
        return instance;
    }

}
